import uiautomator2 as u2
import time

# 连接设备
device = u2.connect()
## Android KEYCODE键值对应大全
# https://blog.csdn.net/midux/article/details/80064054

## 唤醒
# device.screen_on()
## 休息五秒钟
# time.sleep(5)
## 息屏
# device.screen_off()

## 音量增加
# device.press("volume_up")
# time.sleep(2)
## 音量减少
# device.press("volume_down")
## 静音
# device.press("volume_mute")
## 最近运行的程序
device.press("recent")

